package com.it.travel.service.impl;

import com.it.travel.service.ContactService;
import com.it.travel.service.EmailService;
import com.it.travel.vo.Params.ContactParams;
import com.it.travel.vo.Result;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.mail.MessagingException;

@Service
public class ContactServiceImpl implements ContactService {

    @Resource
    private EmailService emailService;

    @Override
    public Result<?> sendEmail(ContactParams contactParams) {

        try {
            emailService.sendEmailForContact(contactParams);
        } catch (MessagingException e) {
            e.printStackTrace();
        }
        return Result.success(null, "发送成功");
    }
}
